/**
 * 系统管理api
 */

import axios from '@/libs/api.request'
export default class systemApi {
  // 系统管理参数设置列表
  static getPlanList = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/GetList',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  // 查看详情
  static getPlanDetail = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/GetModel',
      method: 'get',
      params: params
    })
  }

  // 删除
  static deletePlan = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/Delete',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  // 地区全部
  static getAllArea = () => {
    return axios.request({
      url: '/SysArea/GetAreaTree',
      method: 'get'
    })
  }

  // 保存
  static saveRevisePlan = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/Save',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  // 获取新增时的信息
  static addModalInfo = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/GetAddModel',
      method: 'get',
      params: params
    })
  }

  // 根据收费精度计算缴纳金额
  static getTotalAmount = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/GetTotalAmount',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  // 导出
  static exportData = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/Export',
      method: 'post',
      data: params
    })
  }

  // 下载导入模板
  static exportTemplate = (params) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/ExportTemplate',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }
  // 下载错误数据模板
  static exportErrorTemplate = (name) => {
    return axios.request({
      url: '/SysWelfarePercentAreaConfig/ExportErrorFile?fileName=' + name,
      method: 'get',
      responseType: 'blob'
    })
  }
}
